﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Kinect.Framework.Controls;

namespace Kinect.ShowCase.Views
{
    /// <summary>
    /// Interaction logic for KinectContextMenuView.xaml
    /// </summary>
    public partial class KinectContextMenuView : UserControl
    {
        public KinectContextMenuView()
        {
            InitializeComponent();
            Loaded += new RoutedEventHandler(KinectContextMenuView_Loaded);
        }
        void ContextMenu_OnKinectItemSelected(object s, Framework.Lib.PayloadEventArgs<Framework.Interfaces.IKinectElement> e)
        {
            Debug.Text = ((KinectButton)e.Payload).ToString()+ " selected !";
        }

        void KinectContextMenuView_Loaded(object sender, RoutedEventArgs e)
        {
            ((MainWindow)KinectWindow.GetWindow(this)).ContextMenu.IsEnabled = true;
            ((MainWindow)KinectWindow.GetWindow(this)).ContextMenu.OnKinectItemSelected += new KinectContextMenu.OnKinectItemSelectedEventHandler(ContextMenu_OnKinectItemSelected);
        }
    }
}
